﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;

namespace MobileBroadbandLoggingMonitor.Web
{
    public partial class TestCommit : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
          
        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
              ASCIIEncoding encoding = new ASCIIEncoding();
            string postData = string.Empty;
            postData += "firstValue=" + Server.UrlEncode(txb1.Text);
            postData += "&email=" + Server.UrlEncode(txb2.Text);
            byte[] data = encoding.GetBytes(postData);

            // Prepare web request...
            HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://apps.mobilebroadbanduser.eu/CommitSharedInformation.aspx");
            //HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://localhost:64067/CommitSharedInformation.aspx");
        
            myRequest.Method = "POST";
            myRequest.ContentType = "application/x-www-form-urlencoded";
            myRequest.ContentLength = data.Length;
            using (Stream newStream = myRequest.GetRequestStream())
            {
                // Send the data.
                newStream.Write(data, 0, data.Length);
                newStream.Close();
            }
        }
    }
}
